<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
	.red{color:red;}
</style>
</head>
<body>
	<table border="1" align="center" cellpadding="0" cellspacing="0">
		<tr align="center">
			<td colspan="4"><h2>在线问答</h2></td>
		</tr>
		<tr align="center">
			<td colspan="4"><a href="${pageContext.request.contextPath }/myquestion.html">我要提问</a></td>
		</tr>
		<tr align="center" style="background-color: blue">
			<td>序号</td>
			<td>问题</td>
			<td>回答次数</td>
			<td>最后修改</td>
		</tr>
		
		<c:if test="${qList !=null }">
			<c:forEach var="qu" items="${qList }" varStatus="st">
				<tr align="center" <c:if test="${st.index%2==1 }"> style="background-color:green"</c:if>>
					<td>${st.index+1 }</td>
					<td><a href="${pageContext.request.contextPath }/search.html?id=${qu.id }">
						<span class="${qu.answerCount=='0'?'red':''}">${qu.title }</span>
						</a>
					</td>
					<td>${qu.answerCount }</td>
					<td>${qu.lastModified }</td>
				</tr>
			</c:forEach>
		</c:if>
	</table>
</body>
</html>